package com.smedi.ismedi.personnel.api.feign;

import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: xulinjun
 * @Date: 2021-6-12 14:38
 */
@Api(tags = {"人员校验接口"})
@FeignClient(name = "ismedi-personnel")
@RequestMapping(value = "/api/v1/personnel/validate")
public interface RemotePersonValidateFeignApi {
    /**
     * 校验人员是否有效
     *
     * @param personId
     * @return
     */
    @ApiOperation(httpMethod = "GET", value = "校验人员是否有效")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "personId", value = "人员id", dataType = "Long", dataTypeClass = Long.class),
    })
    @GetMapping(value = "/checkPersonAvailable")
    ResponseData<Boolean> getCheckPersonAvailable(@RequestParam(value = "personId") Long personId);

    /**
     * 判断人员是否为企业人员
     *
     * @param personId
     * @return
     */
    @ApiOperation(httpMethod = "GET", value = "判断人员是否为企业人员")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "personId", value = "人员id", dataType = "Long", dataTypeClass = Long.class),
    })
    @GetMapping(value = "/checkPersonIsInternal")
    ResponseData<Boolean> getCheckPersonIsInternal(@RequestParam(value = "personId") Long personId);

    /**
     * 判断人员是否为项目人员
     *
     * @param personId
     * @return
     */
    @ApiOperation(httpMethod = "GET", value = "判断人员是否为项目人员")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "personId", value = "人员id", dataType = "Long", dataTypeClass = Long.class),
    })
    @GetMapping(value = "/checkPersonIsExternal")
    ResponseData<Boolean> getCheckPersonIsExternal(@RequestParam(value = "personId") Long personId);

    /**
     * 判断企业组织下是否有员工分配
     *
     * @param hrOrganizationId
     * @return
     */
    @ApiOperation(httpMethod = "GET", value = "判断企业组织下是否有员工分配")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "hrOrganizationId", value = "企业组织id", dataType = "Long", dataTypeClass = Long.class),
    })
    @GetMapping(value = "/checkHrOrganizationHasPerson")
    ResponseData<Boolean> getCheckHrOrganizationHasPerson(@RequestParam(value = "hrOrganizationId") Long hrOrganizationId);
}
